package com.example.springaop.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2024-12-25
 * Time: 20:12
 */
@Slf4j
@Aspect
//@Component
public class AspectDemo5 {
    @Pointcut("execution(* com.example.springaop.controller.*.*(..))")
    private void pt() {
    }

    //前置通知
    @Before("pt()")//全限定类名.方法名
    public void doBefore() {
        log.info("执行AspectDemo5——————>doBefore方法");
    }

    //后置通知
    @After("pt()")
    public void doAfter() {
        log.info("执行AspectDemo5——————>doAfter方法");
    }
}
